package br.com.comdoc.cadastro;

//@author Keanujorge

import br.com.comdoc.interfaces.InterfaceEmpresa;
import br.com.comdoc.repositorio.RepositorioEmpresa;
import java.util.ArrayList;
import javax.swing.JOptionPane;


public class CadastroEmpresa implements InterfaceEmpresa {

    @Override
    public void salvar(int idEndereco, int idContato, String razaoSocial, String nomeFantazia, 
    String CNPJ, String IE, int situacao) {
        
        if(CNPJ.trim().length() == 0){
            JOptionPane.showMessageDialog(null, "É necessário digitar um CNPJ.");
        } else if(razaoSocial.trim().length() == 0){
            JOptionPane.showMessageDialog(null, "É necessário digitar a razão social da empresa.");
        } else{
            InterfaceEmpresa repoEmpresa = new RepositorioEmpresa();
            repoEmpresa.salvar(idEndereco, idContato, razaoSocial, nomeFantazia, 
                    CNPJ, IE, situacao);
        }
        
    }

    @Override
    public void alterar(int idEndereco, int idContato, String razaoSocial, String nomeFantazia, 
    String CNPJ, String IE, int situacao) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void excluir(String cnpj) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public ArrayList pegarTodos() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public ArrayList consultarPorCNPJ(String CNPJ) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public ArrayList consultarPorRazaoSocial(String razaoSocial) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public ArrayList consultarPorNomeFantazia(String nomeFantazia) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
    
    
}
